<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <!-- 竞赛类别 -->
    <div class="layui-form-item">
        <label class="layui-form-label">竞赛类别</label>
        <div class="layui-input-block">
            <select name="interest" lay-filter="role">
                <option value="">--请选择--</option>
                <option value="1">市级竞赛</option>
                <option value="2">省级竞赛</option>
                <option value="3">国家级竞赛</option>
            </select>
        </div>
    </div>
    <!-- 年度 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">年度</label>
        <div class="layui-input-block">
            <input id="date" type="text" name="year" lay-verify="required"  placeholder="请选择年度" value="" class="layui-input" readonly>
        </div>
    </div>
    <!-- 题目 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">题目</label>
        <div class="layui-input-block">
            <input type="text" name="titel" lay-verify="required" lay-reqtext="题目不能为空" placeholder="请输入题目" value="" class="layui-input">
            <tip>2-30 个汉字字母组合</tip>
        </div>
    </div>
    <!-- 组长 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">组长</label>
        <div class="layui-input-block">
            <input type="text" name="people" lay-verify="required" lay-reqtext="组长不能为空" placeholder="请输入组长" value="" class="layui-input">
            <tip>汉字 2-6 个</tip>
        </div>
    </div>
    <!-- 组员 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">组员</label>
        <div class="layui-input-block">
            <input type="text" name="people" lay-verify="required" lay-reqtext="组员不能为空" placeholder="请输入组员" value="" class="layui-input">
            <tip>汉字 2-6 个</tip>
        </div>
    </div>
    <!-- 获奖等级 -->
    <div class="layui-form-item">
        <label class="layui-form-label">获奖等级</label>
        <div class="layui-input-block">
            <select name="interest" lay-filter="role">
                <option value=""></option>
                <option value="1">特等奖</option>
                <option value="2">一等奖</option>
                <option value="3" >二等奖</option>
                <option value="4" >三等奖</option>
                <option value="5" >优秀奖</option>
                <option value="6"selected>无</option>
            </select>
        </div>
    </div>
    <!-- 指导老师-->
    <div class="layui-form-item">
        <label class="layui-form-label required">指导老师</label>
        <div class="layui-input-block">
            <input type="text" name="realname" lay-verify="required" lay-reqtext="指导老师不能为空" placeholder="请输入指导老师" value="" class="layui-input" required>
            <tip>2-6 个汉字，必填</tip>
        </div>
    </div>
    <!-- 提交 -->
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>

<script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form','laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            laydate = layui.laydate
        $ = layui.$;
        //年选择器
        laydate.render({
            elem: '#date'
            ,type: 'year',
            max:'2021',
        });

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var index = layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            }, function () {

                // 关闭弹出层
                layer.close(index);

                var iframeIndex = parent.layer.getFrameIndex(window.name);
                parent.layer.close(iframeIndex);

            });

            return false;
        });

    });
</script>
</div>
</body>
</html>